<template>
  <div class="barChart" ref="barChart">bar</div>
</template>

<script>
import echarts from "echarts";
export default {
  name: "barChart",
  mounted() {
    let myCharts = echarts.init(this.$refs.barChart);
    myCharts.setOption({
      xAxis: {
        type: "category",
        show: false,
      },
      yAxis: {
        show: false,
      },
      series: [
        {
          type: "bar",
          data: [30, 50, 60, 20, 30],
          color: "cyan",
        },
      ],
      tooltip: {},
      //布局调试
      grid: {
        left: 0,
        top: 0,
        right: 0,
        bottom: 0,
      },
    });
  },
};
</script>

<style>
.barChart {
  width: 100%;
  height: 100%;
}
</style>